<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../JS/vue.js"></script>
</head>
<body>
    <div id="app">
        <h2>{{firstName}}</h2>
        <h2>{{secondName}}</h2>
        <h2>{{fullName}}</h2>
    </div>
    <script>
        const app = new Vue({
            el: '#app',
            data:{
                firstName:'john',
                secondName:'lily'
            },
            methods:{
                
            },
            computed:{
                //计算属性一般没有set方法
                fullName: {
                    set: function(){
                        console.log('----------------');
                        
                    },
                    get:function () {
                   return this.firstName+" "+this.secondName
                }
            }
            }
        })
    </script>
</body>
</html>